package com.hongyue.neiBuLei;

public class Demo1 {
    public static void main(String[] args) {
        JieKou jieKou = new JieKou() {
            @Override
            public void test() {
                System.out.println("11111");
            }
        };
        jieKou.test();

        jieKou(jieKou);

        jieKou1(new JieKou() {
            @Override
            public void test() {
                System.out.println("22222");
            }
        });

        jieKou2().test();
    }

    private static JieKou jieKou2() {
        return new JieKou() {
            @Override
            public void test() {
                System.out.println("3333");
            }
        };
    }

    private static void jieKou1(JieKou jieKou) {
        jieKou.test();
    }

    private static void jieKou(JieKou jieKou) {
        jieKou.test();
    }
}
